package com.wish.dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import org.springframework.stereotype.Service;

import com.wish.model.Permission;

@Service
public class PermissionDao {
	@PersistenceContext
	private EntityManager em;
	
	@SuppressWarnings("unchecked")
	public List<Permission> getList(){
		Query query = em.createQuery("select p from Permission p order by p.id desc");
		return query.getResultList();
	}
}
